package com.app.test1;

import java.util.HashMap;
import java.util.Map;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test1")
@EnableAutoConfiguration
public class Example {

	@RequestMapping(value = "/", method = { RequestMethod.GET }, produces = "application/json")
	@ResponseBody
	private Map<String, Object> home() {
		Map<String, Object> map = new HashMap<>();
		map.put("name", "zhangsan");
		map.put("age", 12);

		return map;
	}

	private @RequestMapping("/hello/{myName}")
	String index(@PathVariable String myName) {
		return "Hello " + myName + "!!!";
	}
}
